package com.lcm.oj.lanqiao.year2021.moni.demo;

import java.lang.management.ManagementFactory;
import java.util.Scanner;

/**
 * @author Coder-lcm
 * @date 2021/4/17
 *
 *  线段树
 */
public class Test {
    public static void main(String[] args) {
        // 求编号从l~r的所有数之和
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt();
        int r = sc.nextInt();
        int[] sum = new int[100001];
        sum[1] = 1;
        for (int i = 2; i <= 10000; i++) {
            sum[i] = sum[i-1] + i;
        }

        System.out.println(sum[r] - sum [l-1]);

    }
}
